﻿<Segmented Labels=@_options @bind-Value="_value" />

<Button Type="ButtonType.Primary" Disabled=@_moreLoaded OnClick=@handleLoadOptions>
    Load more options
</Button>

@code {
    string[] _defaultOptions = { "Daily", "Weekly", "Monthly" };
    string[] _options = { };
    string _value = "Weekly";

    bool _moreLoaded;

    protected override void OnInitialized()
    {
        _options = _defaultOptions;
    }

    private void handleLoadOptions()
    {
        _options = _defaultOptions.Concat(new[] { "Quarterly", "Yearly" }).ToArray();
        _value = "Quarterly";
        _moreLoaded = true;
    }
}
